import request from '@/utils/request'

export const getCarRulesAPI = (params) => {
  return request({
    url: '/park/sys/role',
    params
  })
}
// 获取树形列表
export const getCarRuleTreeAPI = () => {
  return request({
    url: '/park/sys/permision/all/tree'
  })
}
// 获取详情
export const getCarRuleDetailAPI = (roleId) => {
  return request({
    url: `/park/sys/role/${roleId}`
  })
}
// 获取角色列表
export const getCarRuleListAPI = (roleId) => {
  return request({
    url: `/park/sys/roleUser/${roleId}`
  })
}
// 添加
export const addCarRuleAPI = (data) => {
  return request({
    url: '/park/sys/role',
    method: 'POST',
    data
  })
}
// 确定修改
export const updateCarRuleAPI = (data) => {
  return request({
    url: `/park/sys/role`,
    method: 'PUT',
    data
  })
}
// 删除
export const deleteCarRuleAPI = (roleId) => {
  return request({
    url: `/park/sys/role/${roleId}`,
    method: 'DELETE'
  })
}
